SUBROUTINE HIDDENA
* Display a simple form, with name and address fields and checkboxes* for the user to select the type of information required* Include a form identifier as a hidden field* Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
* Start the HTML pageCALL RW_START_HTML_PAGE("Holiday Accommodation in South Ayrshire", "", "", "", "")
BUF="There is a wide range of holiday accommodation available in South Ayrshire"
CALL RWA_NEWLINES(BUF, 2)
BUF=BUF:"Fill in your name and address details then check the relevant box(es) to request details"
CALL RWA_NEWLINES(BUF, 2)* Start the HTML form, specifying that ACCOMDETAILS* should be run when the form is submittedCALL RW_START_HTML_FORM("ACCOMDETAILS", "SAREQUEST", "")* Put the form identifier into a hidden fieldCALL RWA_HIDDEN(BUF, "FORMID", "South Ayrshire", "")* Create the editboxes
BUF=BUF:"Name: "
CALL RWA_EDIT_BOX(BUF,"NAME", 30,"")CALL RWA_NEWLINES(BUF,1)
BUF=BUF:"Address: "
CALL RWA_EDIT_BOX(BUF,"ADD1", 30,"")CALL RWA_NEWLINES(BUF,1)
BUF=BUF:" "
BUF=BUF:" "
CALL RWA_EDIT_BOX(BUF,"ADD2", 30,"")CALL RWA_NEWLINES(BUF,1)
BUF=BUF:" "
BUF=BUF:" "
CALL RWA_EDIT_BOX(BUF,"ADD3", 30,"")CALL RWA_NEWLINES(BUF,1)
BUF=BUF:"Postcode: "
CALL RWA_EDIT_BOX(BUF, "PCODE", 7, "")CALL RWA_NEWLINES(BUF,2)* Create the checkboxesCALL RWA_CHECKBOX(BUF, "accomtype", "Hotels", 0, 0, "")
BUF= BUF: "Hotels"
CALL RWA_NEWLINES(BUF, 1)CALL RWA_CHECKBOX(BUF, "accomtype", "Bed and Breakfast", 0, 0, "")
BUF= BUF: "Bed and Breakfast"
CALL RWA_NEWLINES(BUF, 1)CALL RWA_CHECKBOX(BUF, "accomtype", "Self Catering", 0, 0, "")
BUF= BUF: "Self Catering"
CALL RWA_NEWLINES(BUF, 1)CALL RWA_CHECKBOX(BUF, "accomtype", "Camping", 0, 0, "")
BUF= BUF: "Camping"
CALL RWA_NEWLINES(BUF, 2)* Create a reset buttonCALL RWA_RESET(BUF, "CLEAR", "Clear Selections", "")* Create the submit buttonCALL RWA_SUBMIT_BUTTON(BUF, "Submit Request","")* Display the formCALL RW_PUT(BUF)* Complete the formCALL RW_END_FORM* Complete the pageCALL RW_END_PAGE
RETURN
SUBROUTINE ACCOMDETAILS
*Acknowledge request for details of holiday accommodation*in a specific area of Scotland*Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
EQU VM TO CHAR(253)
*Start the HTML pageCALL RW_START_HTML_PAGE("Request Acknowledgement", "", "", "", "")*Get the name and address from the submitted formCALL RW_GET_PARAM("NAME", NAME)CALL RW_GET_PARAM("ADD1", ADD1)CALL RW_GET_PARAM("ADD2", ADD2)CALL RW_GET_PARAM("ADD3", ADD3)CALL RW_GET_PARAM("PCODE",PCODE)*Get the form identifier - indicating the relevant area -*which was submitted as a hidden fieldCALL RW_GET_PARAM("FORMID", AREA)CALL RW_PUT("Thank you for your interest in holiday accommodation in ")CALL RW_PUT(AREA)CALL RW_NEWLINES(2)*Get the value of "accomtype" from the submitted form*Multiple checkboxes may be have been selected, so the value returned*will be a string of all selected modules separated by Value MarksCALL RW_GET_PARAM("accomtype", TYPES)
IF TYPES NE "" THEN
TYPES2 = CHANGE(TYPES, VM, ", ")
CALL RW_PUT('We will send details of the following "':TYPES2:'" to ')CALL RW_NEWLINECALL RW_PUT(NAME)CALL RW_NEWLINECALL RW_PUT(ADD1)CALL RW_NEWLINECALL RW_PUT(ADD2)CALL RW_NEWLINECALL RW_PUT(ADD3)CALL RW_NEWLINECALL RW_PUT(PCODE)
END
* Complete the pageCALL RW_END_PAGE
RETURN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Holiday Accommodation in South Ayrshire</TITLE></HEAD><BODY><FORM ACTION="ACCOMDETAILS" NAME="SAREQUEST" METHOD="POST">
There is a wide range of holiday accommodation available in South Ayrshire<BR><BR>
Fill in your name and address details then check the relevant box(es) to request details<BR><BR><INPUT TYPE="HIDDEN" NAME="FORMID" VALUE="South Ayrshire">
Name: <INPUT NAME="NAME" SIZE="30" TYPE="TEXT"><BR>
Address: <INPUT NAME="ADD1" SIZE="30" TYPE="TEXT"><BR>
<INPUT NAME="ADD2" SIZE="30" TYPE="TEXT"><BR>
<INPUT NAME="ADD3" SIZE="30" TYPE="TEXT"><BR>
Postcode: <INPUT NAME="PCODE" SIZE="7" TYPE="TEXT"><BR><BR><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Hotels">
Hotels<BR><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Bed and Breakfast">
Bed and Breakfast<BR><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Self Catering">
Self Catering<BR><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Camping">
Camping<BR><BR><INPUT TYPE=RESET NAME="CLEAR" VALUE="Clear Selections"><INPUT TYPE="submit" VALUE="Submit Request"></FORM></BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Request Acknowledgement</TITLE></HEAD><BODY>
Thank you for your interest in holiday accommodation in
South Ayrshire
<BR><BR>
We will send details of the following "Hotels, Bed and Breakfast" to
<BR>
Paul Williamson
<BR>
64 Meridian Way
<BR>
Barnet
<BR><BR><BR>
EN4 1AB
</BODY></HTML>